home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Examples / Skeleton / UCommandSkeleton.cp < prev    next >
Encoding:
Text File  |  1996-04-03  |  3.1 KB  |  91 lines  |  [TEXT/MPS ]

  1. //----------------------------------------------------------------------------------------
  2. // UCommandSkeleton.cp
  3. // Copyright © 1991-96 by Apple Computer, Inc. All rights reserved. 
  4. //----------------------------------------------------------------------------------------
  5.  
  6. #ifndef __UCOMMANDSKELETON__
  7. #include "UCommandSkeleton.h"
  8. #endif
  9.  
  10. #ifndef __UDOCUMENTSKELETON__
  11. #include "UDocumentSkeleton.h"
  12. #endif
  13.  
  14.  
  15. //========================================================================================
  16. // CLASS TCommandSkeleton
  17. //========================================================================================
  18. #undef Inherited
  19. #define Inherited TCommand
  20.  
  21. #pragma segment ASelCommand
  22. MA_DEFINE_CLASS_M1(TCommandSkeleton, Inherited);
  23.  
  24. //----------------------------------------------------------------------------------------
  25. // TCommandSkeleton constructor 
  26. //----------------------------------------------------------------------------------------
  27. #pragma segment ASelCommand
  28.  
  29. TCommandSkeleton::TCommandSkeleton() 
  30. {
  31.     fDocumentSkeleton = NULL;
  32. } // TCommandSkeleton::Initialize 
  33.  
  34. //----------------------------------------------------------------------------------------
  35. // TCommandSkeleton destructor
  36. //----------------------------------------------------------------------------------------
  37. #pragma segment MADestructorRes
  38.  
  39. TCommandSkeleton::~TCommandSkeleton()
  40. {
  41. }
  42.  
  43. //----------------------------------------------------------------------------------------
  44. // TCommandSkeleton::ICommandSkeleton: 
  45. //----------------------------------------------------------------------------------------
  46. #pragma segment ASelCommand
  47.  
  48. void TCommandSkeleton::ICommandSkeleton(CommandNumber itsCommandNumber,
  49.                                                 TDocumentSkeleton* itsDocumentSkeleton)
  50. {
  51.     this->ICommand(itsCommandNumber,itsDocumentSkeleton,kCanUndo,kCausesChange,itsDocumentSkeleton);
  52.     fDocumentSkeleton = itsDocumentSkeleton;
  53. } // TCommandSkeleton::ICommandSkeleton 
  54.  
  55. //----------------------------------------------------------------------------------------
  56. // TCommandSkeleton::DoIt: 
  57. //----------------------------------------------------------------------------------------
  58. #pragma segment ADoCommand
  59.  
  60. void TCommandSkeleton::DoIt() // Override 
  61. {
  62.     SysBeep(2);
  63. } // TCommandSkeleton::DoIt 
  64.  
  65. //----------------------------------------------------------------------------------------
  66. // TCommandSkeleton::RedoIt: 
  67. //----------------------------------------------------------------------------------------
  68. #pragma segment ADoCommand
  69.  
  70. void TCommandSkeleton::RedoIt(void) // override 
  71. {
  72.     Inherited::RedoIt();    // TCommand::RedoIt simply calls DoIt, but this is not
  73.                             // always adequate
  74. } // TCommandSkeleton::RedoIt 
  75.  
  76. //----------------------------------------------------------------------------------------
  77. // TCommandSkeleton::UndoIt: 
  78. //----------------------------------------------------------------------------------------
  79. #pragma segment ADoCommand
  80.  
  81. void TCommandSkeleton::UndoIt() // Override 
  82. {
  83.     SysBeep(2);
  84.     SysBeep(2);
  85. } // TCommandSkeleton::UndoIt 
  86.  
  87. //----------------------------------------------------------------------------------------
  88. // End of UCommandSkeleton.cp
  89.  
  90. #pragma segment Inline
  91.